<script  src="__STATIC__//plugs/datePicker/WdatePicker.js"></script>

<form class="layui-form layui-box modal-form-box" id="ProductForm" action="{:request()->url()}" data-auto="true" method="post" enctype="multipart/form-data">

    <div class="layui-form-item">
        <label class="layui-form-label">添加明星</label>
        <div class="layui-input-block">
            <input type="text" name="name" value='{$vo.name|default=""}' required title="请输入名称" placeholder="请输入名称" class="layui-input">
            <input type="text" name="birthday" value='{$vo.birthday|default=""}' id="countTimestart" onfocus="selecttime()" required title="生日" placeholder="生日" class="layui-input">
            <input type="text" name="tag" value='{$vo.tag|default=""}' required title="标签" placeholder="标签" class="layui-input">
            <input type="text" name="introduce" value='{$vo.introduce|default=""}' required title="简介" placeholder="简介" class="layui-input">

            <div class="form-group">
                <label class="col-sm-2 control-label label-required">头像</label>
                <div class='col-sm-8'>
                    <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                        <thead>
                        <tr>
                            <td>头像</td>

                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="text-top" style="width:100px">
                                <input type="hidden" name="headurl" value="{$vo.goods_logo|default=''}">
                            </td>

                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <img src='{$vo.headurl|default=""}'>

        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

</form>


<script>
    $('#ProductForm [name="headurl"]').uploadOneImage();
//时间选择
        function selecttime(){
                var startTime = $("#countTimestart").val();
                if(startTime != ""){
                    WdatePicker({dateFmt:'yyyy-MM-dd ',minDate:startTime});
                }else{
                    WdatePicker({dateFmt:'yyyy-MM-dd '});
                }
        }
</script>
